-------------------------------------------------------------------------------
---! 对外接口
-------------------------------------------------------------------------------

local M = {}

function M:send_packet(MsgType, MsgValue, exclude_player_ids)
    if type(exclude_player_ids) == "table" then
        for _, playerId in ipairs(exclude_player_ids) do
            if playerId ==self then
                return
            end
        end
    elseif type(exclude_player_ids) == "number" then
        local playerId = exclude_player_ids
        if playerId == self then
            return
        end
    end

    local clientAddr = self:query_temp("clientAddr")
    if not clientAddr then
        return
    end

    local clientId = self:query_temp("clientId")
    if not clientId then
        return
    end

    return USER_D:send_packet(clientAddr, clientId, MsgType, MsgValue)
end

function M:process_command(MsgType, MsgData)
    return COMMAND_D:process_command(self, MsgType, MsgData)
end

F_CHAR_COMM = M
